package com.secondriver.url.filter;

import static org.junit.Assert.*;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;

import com.secondriver.url.admin.groovy.AdminServiceDao;

class TestInstallScript {

	private static AdminServiceDao adminServiceDao;

	@BeforeClass
	public static void setUpBeforeClass() throws Exception {
		def dbConfig='''url=jdbc:postgresql://localhost:5432/test|user=postgres|password=postgres|driver=org.postgresql.Driver''';
		adminServiceDao=new AdminServiceDao(dbConfig);
	}

	@AfterClass
	public static void tearDownAfterClass() throws Exception {
		adminServiceDao=null;
	}

	@Before
	public void setUp() throws Exception {
		println('===Test Start===');
	}

	@After
	public void tearDown() throws Exception {
		println('===Test End===');
	}
	@Test
	public void test() {
		def params=['method':'install','db':'postgres'];
		println adminServiceDao.service(params);
	}
}
